class Student {
    private String id;
    private String name;
    private String gender;
    private Course selectedCourse;

    public Student(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    public void selectCourse(Course course) {
        this.selectedCourse = course;
        System.out.println("学生" + name + "选择课程：" + course.getName());
    }

    public void dropCourse() {
        if (selectedCourse != null) {
            System.out.println("学生" + name + "退选课程：" + selectedCourse.getName());
            selectedCourse = null;
        } else {
            System.out.println("学生" + name + "未选课程，无法退课");
        }
    }

    public void printSchedule(Teacher teacher) {
        if (selectedCourse != null) {
            System.out.println("学生" + name + "的课表：");
            System.out.println("编号：" + selectedCourse.getId() + "，课程名称：" + selectedCourse.getName() + 
                               "，上课地点：" + selectedCourse.getLocation() + "，时间：" + selectedCourse.getTime() + 
                               "，授课教师：" + teacher.getName());
        } else {
            System.out.println("学生" + name + "暂无选课记录");
        }
    }

    public String getId() { return id; }
    public String getName() { return name; }
    public Course getSelectedCourse() { return selectedCourse; }
}